using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Resources;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace KPIS.GERP.Models.HRM
{
    [DataContract]
	[Table("HrmMpPosition")]
    public class MpPosition
    {
		[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
		[DataMember, Display(Name = "PosId", ResourceType = typeof(Resources.MpPositionsResource))]
        public int PosId { get; set; }

		[DataMember, Display(Name = "PosRef", ResourceType = typeof(Resources.MpPositionsResource))]
        public string PosRef { get; set; }

		[DataMember, Display(Name = "PosName", ResourceType = typeof(Resources.MpPositionsResource))]
        public string PosName { get; set; }

		[ForeignKey("FieldPos")]
		[DataMember, Display(Name = "FieldPosId", ResourceType = typeof(Resources.MpPositionsResource))]
        public Nullable<int> FieldPosId { get; set; }

		[ForeignKey("ExecPos")]
		[DataMember, Display(Name = "ExecPosId", ResourceType = typeof(Resources.MpPositionsResource))]
        public Nullable<int> ExecPosId { get; set; }

		[ForeignKey("EmpType")]
		[DataMember, Display(Name = "EmpTypeId", ResourceType = typeof(Resources.MpPositionsResource))]
        public Nullable<int> EmpTypeId { get; set; }

		[DataMember, Display(Name = "DateDefined", ResourceType = typeof(Resources.MpPositionsResource))]
        public Nullable<System.DateTime> DateDefined { get; set; }

		[DataMember, Display(Name = "DateMoneySupport", ResourceType = typeof(Resources.MpPositionsResource))]
        public Nullable<System.DateTime> DateMoneySupport { get; set; }

		[DataMember, Display(Name = "DateChanged", ResourceType = typeof(Resources.MpPositionsResource))]
        public Nullable<System.DateTime> DateChanged { get; set; }

		[DataMember, Display(Name = "ChangeRefNo", ResourceType = typeof(Resources.MpPositionsResource))]
        public string ChangeRefNo { get; set; }

		[DataMember, Display(Name = "SalaryQuota", ResourceType = typeof(Resources.MpPositionsResource))]
        public Nullable<double> SalaryQuota { get; set; }

		[DataMember, Display(Name = "LastSalaryQuota", ResourceType = typeof(Resources.MpPositionsResource))]
        public Nullable<double> LastSalaryQuota { get; set; }

		[ForeignKey("JobSite")]
		[DataMember, Display(Name = "JobSiteId", ResourceType = typeof(Resources.MpPositionsResource))]
        public Nullable<int> JobSiteId { get; set; }

		[DataMember, Display(Name = "PosStatus", ResourceType = typeof(Resources.MpPositionsResource))]
        public string PosStatus { get; set; }

		[DataMember, Display(Name = "SalaryMin", ResourceType = typeof(Resources.MpPositionsResource))]
        public Nullable<double> SalaryMin { get; set; }

		[DataMember, Display(Name = "SalaryMax", ResourceType = typeof(Resources.MpPositionsResource))]
        public Nullable<double> SalaryMax { get; set; }

		[DataMember, Display(Name = "PosExecSalary", ResourceType = typeof(Resources.MpPositionsResource))]
        public Nullable<double> PosExecSalary { get; set; }

		[ForeignKey("PosUpper")]
		[DataMember, Display(Name = "PosUpperId", ResourceType = typeof(Resources.MpPositionsResource))]
        public Nullable<int> PosUpperId { get; set; }

		[ForeignKey("PosWorkingUpper")]
		[DataMember, Display(Name = "PosWorkingUpperId", ResourceType = typeof(Resources.MpPositionsResource))]
        public Nullable<int> PosWorkingUpperId { get; set; }

		[DataMember, Display(Name = "JobDescription", ResourceType = typeof(Resources.MpPositionsResource))]
        public string JobDescription { get; set; }

		[ForeignKey("Skill")]
		[DataMember, Display(Name = "SkillId", ResourceType = typeof(Resources.MpPositionsResource))]
        public Nullable<int> SkillId { get; set; }

		[DataMember, Display(Name = "Remarks", ResourceType = typeof(Resources.MpPositionsResource))]
        public string Remarks { get; set; }

		[DataMember, Display(Name = "RecordStatus", ResourceType = typeof(Resources.MpPositionsResource))]
        public string RecordStatus { get; set; }

		[DataMember, Display(Name = "CreatedBy", ResourceType = typeof(Resources.MpPositionsResource))]
        public Nullable<int> CreatedBy { get; set; }

		[DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(Resources.MpPositionsResource))]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

		[DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(Resources.MpPositionsResource))]
        public Nullable<int> UpdatedBy { get; set; }

		[DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(Resources.MpPositionsResource))]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

		[DataMember, Display(Name = "SalaryGlow", ResourceType = typeof(Resources.MpPositionsResource))]
        public Nullable<double> SalaryGlow { get; set; }

        [ForeignKey("Currency")]
		[DataMember, Display(Name = "CurrencyId", ResourceType = typeof(Resources.MpPositionsResource))]
        public Nullable<int> CurrencyId { get; set; }



        //[DataMember, Display(Name = "HrmMpExecPositions", ResourceType = typeof(Resources.MpPositionsResource))]
        //public virtual HRM.MpExecPosition HrmMpExecPositions { get; set; }

        //[DataMember, Display(Name = "HrmPsEmployeeTypes", ResourceType = typeof(Resources.MpPositionsResource))]
        //public virtual HRM.MasEmployeeType HrmPsEmployeeTypes { get; set; }

        //[ForeignKey("job_site_seq")]

        //[DataMember, Display(Name = "HrmMpJobSites", ResourceType = typeof(Resources.MpPositionsResource))]
        //public virtual HRM.JobSite HrmMpJobSites { get; set; }
        //[NotMapped()]
        //[ForeignKey("upper_pos_seq")]

        //[DataMember, Display(Name = "HrmMpPositions", ResourceType = typeof(Resources.MpPositionsResource))]
        //public virtual HRM.MpPosition HrmMpPositions_upper { get; set; }
        //[NotMapped()]
        //[ForeignKey("pos_working_upper_seq")]

        //[DataMember, Display(Name = "HrmMpPositions", ResourceType = typeof(Resources.MpPositionsResource))]
        //public virtual HRM.MpPosition HrmMpPositions_working_upper { get; set; }
        ////[DataMember]
        ////public virtual ClassSpecification ClassSpecification { get; set; }

        //[DataMember, Display(Name = "HrmMpPositionSkill", ResourceType = typeof(Resources.MpPositionsResource))]
        //public virtual HRM.MpPositionSkill HrmMpPositionSkill { get; set; }

        //[DataMember, Display(Name = "FimMasCurrencies", ResourceType = typeof(Resources.MpPositionsResource))]
        //public virtual FIM.MasCurrency MasCurrency { get; set; }

        //[DataMember]
        //public virtual ICollection<hrm_mp_positions> hrm_mp_positions_child { get; set; }

        /// <summary>
        /// pos_ref + pos_name
        /// </summary>
        [NotMapped]

		[DataMember, Display(Name = "PosText", ResourceType = typeof(Resources.MpPositionsResource))]
        public string PosText
        {
            get
            {
                return PosRef + " : " + PosName;
            }
        }

		public virtual FieldPosition FieldPos { get; set; }

		public virtual ExecutivePosition ExecPos { get; set; }

		public virtual MasEmployeeType EmpType { get; set; }

		public virtual HRM.JobSite JobSite { get; set; }

		public virtual Position PosUpper { get; set; }

		public virtual Position PosWorkingUpper { get; set; }

		public virtual HRM.PsEmpSkill Skill { get; set; }

        public virtual HRM.MasCurrency Currency { get; set; }

    }
}